import { createStore, combineReducers } from 'redux'


function num(state = 0, action) {
    console.log('action', action);
    switch (action.type) {
        case '/num/add':
            return state + action.payload
        case '/num/reduce':
            return state - action.payload
        default:
            return state
    }
}

// 合并
const rootReducer = combineReducers({num})
const  store = createStore(rootReducer)
export default store
